﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using NeuralNetworks.Networks;
using NeuralNetworks.ActivationFunctions;
using NeuralNetworks.Learning;

namespace NeuralNetworks
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Form1());

            //ActivationNetwork n = new ActivationNetwork(2, 1, 1, new int[] { 2 }, new LogisticFunction());
            //n.RandomWeights(-1, 1);
            //BackPropagationLearning bpl = new BackPropagationLearning(n);
            //bpl.LearningRate = 0.8;
            //bpl.Momentum = 0.3;
            //Console.WriteLine(bpl.Momentum);

            //double[][] inputs = new double[4][] { new double[] {1,0},
            //                                        new double[] {1,1},
            //                                        new double[] {0,0},
            //                                        new double[] {0,1}
            //};
            //double[][] outputs = new double[4][] {
            //                                    new double[]{1},
            //                                    new double[]{0},
            //                                    new double[]{0},
            //                                    new double[]{1}
            //};

            //for (int i = 0; i < 400000; i++)
            //{
            //    double err = bpl.RunEpoch(inputs, outputs);
            //    if (i % 1000 == 0) Console.WriteLine(err);
            //}

            //for (int i = 0; i < inputs.Length; i++)
            //{
            //    double[] output = n.Compute(inputs[i]);
            //    for (int j = 0; j < outputs[0].Length; j++)
            //    {
            //        Console.Write(output[j]);
            //    }
            //    Console.WriteLine();
            //}
            //Console.ReadKey();
        }
    }
}
